<template>
  <div class="paycontent">
    <van-nav-bar
      class="page-nav-bar"
      title="支付订单"
      left-arrow
      @click-left="$router.go(-1)"
    />
    <van-cell title="订单编号" :value="$route.query.order_sn" />
    <van-cell title="订单金额" :value="$route.query.actual_price + '元'" />
    <div class="choose">请选择支付方式</div>
    <van-radio-group v-model="zhifu">
      <div class="zhifu">
        <van-radio name="1" checked-color="#ee0a24"></van-radio>
        <i class="iconfont icon-weixinzhifu"></i>
        <span>微信支付 </span>
      </div>
    </van-radio-group>
    <div class="tishi">
      小程序只支持微信支付，如需其他支付方式，请到网页端进行支付
    </div>
    <div class="sub" @click="topay">确定</div>
  </div>
</template>

<script>
import { paySuccess } from "@/api/buy";
export default {
  data() {
    return {
      zhifu: '1'
    }
  },
  methods: {
    async topay() {
      await paySuccess({
        orderId:this.$route.query.orderId,
        payType:1
      })
      this.$toast.success('支付成功')
      this.$router.push('/order')
    },
  },
};
</script>
<style lang="less" scoped>
.paycontent {
  background-color: f4f4f4;
  margin-bottom: 140px;
  .choose {
    font-size: 30px;
    padding-left: 30px;
    margin: 20px 0px;
  }
  .zhifu {
    padding-left: 40px;
    background-color: #fff;
    height: 100px;
    display: flex;
    align-items: center;
    .iconfont {
      margin-left: 60px;
      font-size: 50px;
      color: #22ac38;
    }
    span {
      font-size: 30px;
    }
  }
  .tishi {
    padding-left: 20px;
    margin-top: 20px;
    color: #ccc;
    font-size: 20px;
  }
  .sub {
    position: fixed;
    width: 100%;
    bottom: 0;
    left: 0;
    background-color: #e11c34;
    color: #fff;
    font-size: 34px;
    text-align: center;
    height: 90px;
    line-height: 90px;
  }
}
</style>